package com.itstherules.jmsunit.mock;

import static com.itstherules.jmsunit.JmsUnit.sender;
import static com.itstherules.jmsunit.JmsUnit.mock;
import static com.itstherules.jmsunit.expectation.Expectations.eq;
import static com.itstherules.jmsunit.expectation.Expectations.headers;

import org.junit.Test;

import com.itstherules.jmsunit.JmsInlineMock;
import com.itstherules.jmsunit.managers.QueueManagersFactory.QueueManagerType;

public class TwoQueueTest {

	@Test
	public void canVerifyAnotherExpectation() throws Exception {
		JmsInlineMock unit = mock("vm://localhost:61616", QueueManagerType.ActiveMQ);
		
		unit.expects().through("blue").with(eq("blueMessage")).reply("green", "greenMessage", headers("GreenEndPoint"));
		unit.expects().through("green").with(eq("greenMessage"));

		sender("blue", "vm://localhost:61616", QueueManagerType.ActiveMQ).send("blueMessage", headers("Blue"));
		
		unit.verifyAndClose();
	}

}